package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SourceDataHisMapper;
import com.ruoyi.db.domain.SourceDataHis;
import com.ruoyi.source.service.ISourceDataHisService;
import com.ruoyi.common.core.text.Convert;

/**
 * 历史表Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-26
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourceDataHisServiceImpl implements ISourceDataHisService 
{
    @Autowired
    private SourceDataHisMapper sourceDataHisMapper;

    /**
     * 查询历史表
     * 
     * @param id 历史表主键
     * @return 历史表
     */
    @Override
    public SourceDataHis selectSourceDataHisById(Long id)
    {
        return sourceDataHisMapper.selectSourceDataHisById(id);
    }

    /**
     * 查询历史表列表
     * 
     * @param sourceDataHis 历史表
     * @return 历史表
     */
    @Override
    public List<SourceDataHis> selectSourceDataHisList(SourceDataHis sourceDataHis)
    {
        return sourceDataHisMapper.selectSourceDataHisList(sourceDataHis);
    }

    /**
     * 查询历史表列表
     *
     * @param sourceDataHis 历史表
     * @return 历史表
     */
    @Override
    public List<Map<String, Object>> selectSourceDataHisListMap(SourceDataHis sourceDataHis)
    {
        return sourceDataHisMapper.selectSourceDataHisListMap(sourceDataHis);
    }

    /**
     * 新增历史表
     * 
     * @param sourceDataHis 历史表
     * @return 结果
     */
    @Override
    public int insertSourceDataHis(SourceDataHis sourceDataHis)
    {
        return sourceDataHisMapper.insertSourceDataHis(sourceDataHis);
    }

    /**
     * 修改历史表
     * 
     * @param sourceDataHis 历史表
     * @return 结果
     */
    @Override
    public int updateSourceDataHis(SourceDataHis sourceDataHis)
    {
        return sourceDataHisMapper.updateSourceDataHis(sourceDataHis);
    }

    /**
     * 批量删除历史表
     * 
     * @param ids 需要删除的历史表主键
     * @return 结果
     */
    @Override
    public int deleteSourceDataHisByIds(String ids)
    {
        return sourceDataHisMapper.deleteSourceDataHisByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除历史表信息
     * 
     * @param id 历史表主键
     * @return 结果
     */
    @Override
    public int deleteSourceDataHisById(Long id)
    {
        return sourceDataHisMapper.deleteSourceDataHisById(id);
    }
}
